@tailwind base;
@tailwind components;
@tailwind utilities;

/* 全局主题变量定义 */
:root {
	/* 白天主题变量 */
	--theme-bg-primary: #ffffff;
	--theme-bg-secondary: #f8fafc;
	--theme-bg-tertiary: #f1f5f9;
	--theme-bg-image: url('./assets/indexLightBackground.png');
	--theme-text-primary: #1e293b;
	--theme-text-secondary: #64748b;
	--theme-text-tertiary: #94a3b8;
	--theme-border-primary: #e2e8f0;
	--theme-border-secondary: #cbd5e1;
	--theme-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
	--theme-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* 夜间主题变量 */
[data-theme="dark"] {
	--theme-bg-primary: url('./assets/img/indexLightBackground.png');
	--theme-bg-secondary: rgba(30, 41, 59, 0.8);
	--theme-bg-tertiary: rgba(51, 65, 85, 0.8);
	--theme-bg-image: url('./assets/img/indexLightBackground.png');
	--theme-text-primary: #f8fafc;
	--theme-text-secondary: #cbd5e1;
	--theme-text-tertiary: #94a3b8;
	--theme-border-primary: #334155;
	--theme-border-secondary: #475569;
	--theme-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
	--theme-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* 原子化 CSS 类名 */
@layer utilities {

	/* 背景色 */
	.bg-theme-primary {
		background-color: var(--theme-bg-primary);
	}

	.bg-theme-secondary {
		background-color: var(--theme-bg-secondary);
	}

	.bg-theme-tertiary {
		background-color: var(--theme-bg-tertiary);
	}

	/* 背景图片 */
	.bg-theme-image {
		background-image: var(--theme-bg-image);
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
	}

	/* Header 背景 */
	.bg-header {
		background-image: url('./assets/img/ceil.png');
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
	}

	/* Footer 背景 */
	.bg-footer {
		background-image: url('./assets/img/floor.png');
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
	}

	/* 文字颜色 */
	.text-theme-primary {
		color: var(--theme-text-primary);
	}

	.text-theme-secondary {
		color: var(--theme-text-secondary);
	}

	.text-theme-tertiary {
		color: var(--theme-text-tertiary);
	}

	/* 边框颜色 */
	.border-theme-primary {
		border-color: var(--theme-border-primary);
	}

	.border-theme-secondary {
		border-color: var(--theme-border-secondary);
	}

	/* 阴影 */
	.shadow-theme {
		box-shadow: var(--theme-shadow);
	}

	.shadow-theme-lg {
		box-shadow: var(--theme-shadow-lg);
	}

	/* 悬停效果 */
	.hover-bg-theme-secondary:hover {
		background-color: var(--theme-bg-secondary);
	}

	.hover-text-theme-primary:hover {
		color: var(--theme-text-primary);
	}
}

/* 全局样式重置 */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html,
body,
#root {
	width: 100%;
	height: 100%;
}

/* 主题过渡动画 */
* {
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 全局响应式媒体元素 */
img, video {
	max-width: 100%;
	height: auto;
	display: block;
}

/* 移动端滚动优化 */
.content {
	-webkit-overflow-scrolling: touch;
}